package com.kun.index.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 评论表
 * </p>
 *
 * @author kunkun
 * @since 2024-03-12
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("comment")
@ApiModel(value="Comment对象", description="评论表")
public class Comment implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "评论id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "评论内容")
    private String content;

    @ApiModelProperty(value = "所属的博客id")
    private Integer blogId;

    @ApiModelProperty(value = "审核状态")
    private Integer reviewStatue;

    @ApiModelProperty(value = "父评论id")
    @JsonProperty("pId")
    private Integer pId;

    @ApiModelProperty(value = "评论者id")
    private Integer userId;

    @ApiModelProperty(value = "根评论id")
    @JsonProperty("rId")
    private Integer rId;

    @ApiModelProperty(value = "评论创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "评论更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty(value = "乐观锁")
    @Version
    private Integer version;

    @ApiModelProperty(value = "逻辑删除，0：未删除，1：已删除")
    @TableLogic
    private Integer deleted;

    @ApiModelProperty(value = "评论者_姓名")
    @TableField(exist = false)
    private String userNickname;
    @ApiModelProperty(value = "评论者_头像")
    @TableField(exist = false)
    private String userAvatarUrl;
    @ApiModelProperty(value = "评论_子评论列表")
    @TableField(exist = false)
    private List<Comment> childComments;
    @ApiModelProperty(value = "评论_父评论用户姓名")
    @TableField(exist = false)
    @JsonProperty(value = "pNickname")
    private String pNickname;
    @ApiModelProperty(value = "评论_所属博客标题")
    @TableField(exist = false)
    private String blogTitle;





}
